package tsj.ai.alibaba.data.analysis.service.processing;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.springframework.ai.chat.model.ChatResponse;
import reactor.core.publisher.Flux;

import java.util.List;
import java.util.function.Consumer;

/**
 *
 * 问题加工服务
 *
 * @author taoshujian
 * @version 1.0
 * @since 2025-11-14 11:22:44
 */
public interface QueryProcessingService {
    List<String> extractEvidences(String query, String agentId);

    List<String> extractKeywords(String query);

    /**
     * 扩展用户问题为一个List列表
     * @param query 用户问题
     * @param resultConsumer 处理扩展结果的消费者
     * @return AI模型的流式结果
     */
    Flux<ChatResponse> expandQuestion(String query, Consumer<List<String>> resultConsumer);

    Flux<ChatResponse> rewriteStream(String query, String agentId, StringBuilder queryResultCollector) throws Exception;
}
